<?php
/**
 * @var $this yii\web\View
 * @var $model app\modules\admin\models\AdminForm
 *
 */

use app\assets\LoginAsset;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
use yii\helpers\Html;

LoginAsset::register($this);
$this->title = '华商工作平台';
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico">
    <?php $this->head() ?>
</head>
<body class="hold-transition login-page">
<?php $this->beginBody() ?>
<div class="login-box animated fadeInDown">
    <div class="login-logo">
        <a href="#"><b>Admin</b>LTE</a><!--<img src="XXXX" alt="" style="width: 200px;height: 60px;">--></a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <?php $form = ActiveForm::begin([
            'fieldConfig' => [
                'template' => '{beginWrapper}{input}{hint}{error}{endWrapper}',
            ]
        ]);?>

        <?= $form->field($model, 'email', [
            'inputOptions' => [
                'placeholder' => $model->getAttributeLabel('email')
            ],
            'inputTemplate' => '<div class="form-group has-feedback">{input}<span class="glyphicon glyphicon-envelope form-control-feedback"></span></div>'
        ])->textInput();
        ?>

        <?= $form->field($model, 'password', [
            'inputOptions' => [
                'placeholder' => $model->getAttributeLabel('password'),
            ],
            'inputTemplate' => '<div class="form-group has-feedback">{input}<span class="glyphicon glyphicon-lock form-control-feedback"></span></div>'
        ])->passwordInput(); ?>

        <?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
            'captchaAction' => '/admin/default/captcha',
            'options' => [
                'placeholder' => $model->getAttributeLabel('verifyCode'),
                'class' => 'form-control'
            ],
            'template'=>
                '<div class="form-group has-feedback">{input}<span class="glyphicon glyphicon-picture form-control-feedback"></span></div>
            <div class="row">
                <div class="col-xs-8">{image}</div>
                <div class="col-xs-4"><button type="submit" class="btn btn-primary btn-block btn-flat">登录</button></div>
            </div>',
            'imageOptions'=>[
                'style' => 'cursor:pointer'
            ]
        ]); ?>
        <p class="login-box-msg">Sign in to start your session</p>
        <?php ActiveForm::end(); ?>
    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>